home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / CIncludes / iostream.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-26  |  19.2 KB  |  784 lines  |  [TEXT/MPS ]

  1. /*
  2.  *------------------------------------------------------------------------
  3.  * Copyright:
  4.  *      © 1993 by Apple Computer Inc.   All rights reserved.
  5.  *
  6.  * Project:
  7.  *      PowerPC C++ Streams Library
  8.  *
  9.  * Filename:
  10.  *      iostream.h
  11.  *
  12.  * Created:
  13.  *      (unknown)
  14.  *
  15.  * Modified:
  16.  *      Date     Engineer       Comment
  17.  *      -------- -------------- ------------------------------------------
  18.  *      12/01/93 Rudy Wang      Removed the declaration of "static Iostream_init iostream_init;"
  19.  *                              and placed it inside iostream_init.c so that we don't get multiple
  20.  *                              copies of this static object all over the place.
  21.  *      12/17/93 Rudy Wang      Made this file universal.
  22.  *------------------------------------------------------------------------
  23.  */
  24.  
  25. #ifndef __IOSTREAMH__
  26. #define __IOSTREAMH__       1
  27.  
  28. // include string.h - Some inlines use memcpy
  29. #include <string.h>
  30.  
  31. #ifdef EOF
  32. #if EOF != -1
  33. #undef EOF
  34. #define EOF (-1)
  35. #endif
  36. #else
  37. #define EOF (-1)
  38. #endif
  39.  
  40. #ifndef NULL
  41. #define NULL 0
  42. #endif
  43.  
  44. #define zapeof(c)       ((c) & 0377)
  45.  
  46. typedef long streampos;
  47. typedef long streamoff;
  48.  
  49. #ifdef powerc
  50. #pragma options align=power
  51. #endif
  52.  
  53. #ifdef powerc
  54. /*
  55.  * removed from ios.c and placed here to avoid forward reference problem - rjd 921223
  56.  */
  57. union ios_user_union
  58. {
  59.     long i_word;
  60.     void *p_word;
  61. };
  62. #endif
  63.  
  64. class streambuf;
  65. class ostream;
  66.  
  67. class ios
  68. {
  69.  
  70. public:
  71.     /*
  72.      * Some enums are declared in ios to avoid pollution of global namespace
  73.      */
  74.     enum io_state
  75.     {
  76.         goodbit  = 0,
  77.         eofbit   = 1,
  78.         failbit  = 2,
  79.         badbit   = 4,
  80.         hardfail = 0200
  81.     };
  82.     /*
  83.      * hard fail can be set and reset internally, but not via public function
  84.      */
  85.     enum open_mode
  86.     {
  87.         in        =    1,
  88.         out       =    2,
  89.         ate       =    4,
  90.         app       =  010,
  91.         trunc     =  020,
  92.         nocreate  =  040,
  93.         noreplace = 0100
  94.     };
  95.     enum seek_dir
  96.     {
  97.         beg = 0,
  98.         cur = 1,
  99.         end = 2
  100.     };
  101.     /*
  102.      * flags for controlling format
  103.      */
  104.     enum
  105.     {
  106.         skipws     =     01,        // skip whitespace on input
  107.  
  108.         left       =     02,        // padding location
  109.         right      =     04,
  110.         internal   =    010,
  111.  
  112.         dec        =    020,        // conversion base
  113.         oct        =    040,
  114.         hex        =   0100,
  115.  
  116.         showbase   =   0200,        // modifiers
  117.         showpoint  =   0400,
  118.         uppercase  =  01000,
  119.         showpos    =  02000,
  120.  
  121.         scientific =  04000,        // floating point notation
  122.         fixed      = 010000,
  123.  
  124.         unitbuf    = 020000,        // stuff to control flushing
  125.         stdio      = 040000
  126.     };
  127.     static const long basefield;    // = dec | oct | hex
  128.     static const long adjustfield;  // = left | right | internal
  129.     static const long floatfield;   // = scientific | fixed
  130.  
  131. public:
  132.     ios(streambuf*);
  133.     virtual ~ios();
  134.  
  135.     long flags() const          { return x_flags; }
  136.     long flags(long f);
  137.  
  138.     long setf(long setbits, long field);
  139.     long setf(long);
  140.     long unsetf(long);
  141.  
  142.     int  width() const          { return x_width; }
  143.     int  width(int w)           { int i = x_width; x_width = w; return i; }
  144.  
  145.     int  precision(int);
  146.     int  precision() const      { return x_precision; }
  147.  
  148.     char fill(char);
  149.     char fill() const           { return x_fill; }
  150.     ostream* tie(ostream* s);
  151.     ostream* tie()              { return x_tie; }
  152.  
  153.     operator void*()            { return (state & (failbit | badbit | hardfail)) ? NULL : this; }
  154. #ifdef powerc
  155.     operator const void*() const{ return (state & (failbit | badbit | hardfail)) ? NULL : this; }
  156. #endif
  157.     int operator!() const       { return state & (failbit | badbit | hardfail); }
  158.     int rdstate() const         { return state; }
  159.     int eof() const             { return state & eofbit; }
  160.     int fail() const            { return state & (failbit | badbit | hardfail); }
  161.     int bad() const             { return state & badbit; }
  162.     int good() const            { return state == 0; }
  163.     void clear(int i = 0)
  164.     {
  165.         state =  (i & 0377) | (state & hardfail);
  166.         ispecial = (ispecial & ~0377) | state;
  167.         ospecial = (ospecial & ~0377) | state;
  168.     }
  169.     streambuf* rdbuf()          { return bp; }
  170.  
  171. public:
  172.     /*
  173.      * Members related to user allocated bits and words
  174.      */
  175.     long& iword(int);
  176.     void*& pword(int);
  177.     static long bitalloc();
  178.     static int xalloc();
  179.  
  180. private:
  181.     static long nextbit;
  182.     static long nextword;
  183.  
  184.     int nuser;
  185.     union ios_user_union* x_user;
  186.     void uresize(int);
  187.  
  188. public:
  189.     /*
  190.      * static member functions
  191.      */
  192.     static void sync_with_stdio();
  193.  
  194. protected:
  195.     enum
  196.     {
  197.         skipping = 01000,
  198.         tied     = 02000
  199.     };
  200.     /*
  201.      * bits 0377 are reserved for userbits
  202.      */
  203.     streambuf* bp;
  204.     void setstate(int b)
  205.     {
  206.         state |= (b & 0377);
  207.         ispecial |= b & ~skipping;
  208.         ispecial |= b;
  209.     }
  210.     int         state;
  211.     int         ispecial;
  212.     int         ospecial;
  213.     int         isfx_special;
  214.     int         osfx_special;
  215.     int         delbuf;
  216.     ostream*    x_tie;
  217.     long        x_flags;
  218.     short       x_precision;
  219.     char        x_fill;
  220.     short       x_width;
  221.  
  222.     static void (*stdioflush)();
  223.  
  224.     void init(streambuf*);      // Does the real work of a constructor.
  225.     ios();                      // No initialization at all.  Needed by multiple inheritance versions.
  226.     int assign_private;         // Needed by with_assgn classes.
  227.  
  228. private:
  229.     ios(ios&);                  // Declared but not defined
  230.     void operator=(ios&);       // Declared but not defined
  231.  
  232. public:
  233.     /*
  234.      * old stream package compatibility
  235.      */
  236.     int skip(int i);
  237.  
  238. };  // class ios
  239.  
  240.  
  241. class streambuf
  242. {
  243. public:
  244.     /*
  245.      * Constructors -- should be protected
  246.      */
  247.     streambuf();
  248.     streambuf(char* p, int l);
  249.     streambuf(char* p, int l, int c);                   // 3 argument form is obsolete. Use strstreambuf.
  250.  
  251. protected:
  252.     short       alloc;
  253.  
  254. private:
  255.     short       x_unbuf;
  256.     char*       x_base;
  257.     char*       x_pbase;
  258.     char*       x_pptr;
  259.     char*       x_epptr;
  260.     char*       x_gptr;
  261.     char*       x_egptr;
  262.     char*       x_eback;
  263.     int         x_blen;
  264.  
  265. private:
  266.     streambuf(streambuf&);      // Declared but not defined
  267.     void operator=(streambuf&); // Declared but not defined
  268.  
  269. public:
  270.     void dbp();
  271.  
  272. protected:
  273.     char*       base()          { return x_base; }
  274.     char*       pbase()         { return x_pbase; }
  275.     char*       pptr()          { return x_pptr; }
  276.     char*       epptr()         { return x_epptr; }
  277.     char*       gptr()          { return x_gptr; }
  278.     char*       egptr()         { return x_egptr; }
  279.     char*       eback()         { return x_eback; }
  280.     char*       ebuf()          { return x_base + x_blen; }
  281.     int         blen() const    { return x_blen; }
  282.     void        pbump(int n)    { x_pptr += n; }
  283.     void        gbump(int n)    { x_gptr += n; }
  284.     void setp(char* p, char* ep)
  285.     {
  286.         x_pbase = x_pptr = p;
  287.         x_epptr = ep;
  288.     }
  289.     void setg(char* eb, char* g, char* eg)
  290.     {
  291.         x_eback = eb;
  292.         x_gptr = g;
  293.         x_egptr = eg;
  294.     }
  295.     void setb(char* b, char* eb, int a = 0)
  296.     {
  297.         if (alloc && x_base)
  298.             delete x_base;
  299.         x_base = b;
  300.         x_blen = (eb > b) ? (eb - b) : 0;
  301.         alloc = a;
  302.     }
  303.     int unbuffered()            { return x_unbuf; }
  304.     void unbuffered(int unb)    { x_unbuf = (unb != 0); }
  305.     virtual int doallocate();
  306.     int allocate()              { return (x_base == 0 && !unbuffered()) ? doallocate() : 0; }
  307.  
  308. public:
  309.     virtual int overflow(int c = EOF);
  310.     virtual int underflow();
  311.     virtual int pbackfail(int c);
  312.     virtual int sync();
  313.     virtual streampos seekoff(streamoff, ios::seek_dir, int = ios::in | ios::out);
  314.     virtual streampos seekpos(streampos, int = ios::in | ios::out);
  315.     virtual int xsputn(const char* s, int n);
  316.     virtual int xsgetn(char* s, int n);
  317.  
  318.     int in_avail()
  319.     {
  320.         return (x_gptr < x_egptr) ? x_egptr - x_gptr : 0;
  321.     }
  322.     int out_waiting()
  323.     {
  324.         return (x_pptr) ? x_pptr - x_pbase : 0;
  325.     }
  326.     int sgetc()
  327.     {
  328.         /*
  329.          * WARNING: sgetc does not bump the pointer
  330.          */
  331.         return (x_gptr >= x_egptr) ? underflow() : zapeof(*x_gptr);
  332.     }
  333.     int snextc()
  334.     {
  335.         return (++x_gptr >= x_egptr) ? x_snextc() : zapeof(*x_gptr);
  336.     }
  337.     int sbumpc()
  338.     {
  339.         return (x_gptr >= x_egptr && underflow() == EOF) ? EOF : zapeof(*x_gptr++);
  340.     }
  341.     int optim_in_avail()
  342.     {
  343.         return x_gptr < x_egptr;
  344.     }
  345.     int optim_sbumpc()
  346.     {
  347.         return (underflow() == EOF) ? EOF : zapeof(*x_gptr++);
  348.     }
  349.     void stossc()
  350.     {
  351.         if (x_gptr++ > x_egptr)
  352.             underflow();
  353.     }
  354.     int sputbackc(char c)
  355.     {
  356.         if (x_gptr > x_eback)
  357.         {
  358.             if (*--x_gptr == c)
  359.                 return zapeof(c);
  360.             else
  361.                 return zapeof(*x_gptr = c);
  362.         }
  363.         else
  364.             return pbackfail(c);
  365.     }
  366.     int sputc(int c)
  367.     {
  368.         return (x_pptr >= x_epptr) ? overflow(zapeof(c)) : zapeof(*x_pptr++ = c);
  369.     }
  370.     int sputn(const char* s,int n)
  371.     {
  372.         if (n <= (x_epptr - x_pptr))
  373.         {
  374.             memcpy(x_pptr, s, n);
  375.             pbump(n);
  376.             return n;
  377.         }
  378.         else
  379.             return xsputn(s, n);
  380.     }
  381.     int sgetn(char* s,int n)
  382.     {
  383.         if (x_gptr + n <= x_egptr)
  384.         {
  385.             memcpy(s, x_gptr, n);
  386.             gbump(n);
  387.             return n;
  388.         }
  389.         else
  390.             return xsgetn(s, n);
  391.     }
  392.     virtual streambuf* setbuf(char* p, int len);
  393.     streambuf* setbuf(unsigned char* p, int len);
  394.     streambuf* setbuf(char* p, int len, int count);     // obsolete third argument
  395.     virtual ~streambuf();
  396.  
  397. private:
  398.     int x_snextc();
  399.  
  400. };  // class streambuf
  401.  
  402.  
  403. class istream : virtual public ios
  404. {
  405.  
  406. public:
  407.     /*
  408.      * Constructor, destructor
  409.      */
  410.     istream(streambuf*);
  411.     virtual ~istream();
  412.  
  413. public:
  414. #ifdef powerc
  415.     int         ipfx(int need);
  416. #else
  417. #ifdef applec
  418.     int         ipfx(int noskipws = 0)
  419.     {
  420.         return (noskipws ? (ispecial & ~skipping) : ispecial) ? do_ipfx(noskipws) : 1;
  421.     }
  422. #endif
  423. #endif
  424.     void        isfx()                                  { }
  425.     istream&    seekg(streampos p);
  426.     istream&    seekg(streamoff o, ios::seek_dir d);
  427.     streampos   tellg();
  428.     istream&    operator>>(istream& (*f)(istream&))     { return (*f)(*this); }
  429.     istream&    operator>>(ios& (*f)(ios&));
  430.     istream&    operator>>(char*);
  431.     istream&    operator>>(unsigned char*);
  432. #ifdef powerc
  433.     istream&    operator>>(unsigned char& c);
  434.     istream&    operator>>(char& c);
  435. #else
  436. #ifdef applec
  437.     istream&    operator>>(unsigned char& c)
  438.     {
  439.         if (!ispecial && bp->optim_in_avail())
  440.         {
  441.             c = bp->optim_sbumpc();
  442.             return *this;
  443.         }
  444.         else
  445.             return rs_complicated(c);
  446.     }
  447.     istream&    operator>>(char& c)
  448.     {
  449.         if (!ispecial && bp->optim_in_avail())
  450.         {
  451.             c = bp->optim_sbumpc();
  452.             return *this;
  453.         }
  454.         else
  455.             return rs_complicated(c);
  456.     }
  457.     istream&    rs_complicated(unsigned char& c);
  458.     istream&    rs_complicated(char& c);
  459. #endif
  460. #endif
  461.     istream&    operator>>(short&);
  462.     istream&    operator>>(int&);
  463.     istream&    operator>>(long&);
  464.     istream&    operator>>(unsigned short&);
  465.     istream&    operator>>(unsigned int&);
  466.     istream&    operator>>(unsigned long&);
  467.     istream&    operator>>(float&);
  468.     istream&    operator>>(double&);
  469. #ifdef powerc
  470.     istream&    operator>>(long double&);
  471. #else
  472. #ifdef applec
  473.     istream&    operator>>(extended&);
  474.     istream&    operator>>(comp&);
  475. #endif
  476. #endif
  477.     istream&    operator>>(streambuf*);
  478. #ifdef __xlC
  479.     istream&    get(char*,                int lim, char delim = '\015');
  480.     istream&    get(unsigned char* b,     int lim, char delim = '\015');
  481.     istream&    getline(char* b,          int lim, char delim = '\015');
  482.     istream&    getline(unsigned char* b, int lim, char delim = '\015');
  483.     istream&    get(streambuf& sb,                 char delim = '\015');
  484. #else
  485.     istream&    get(char*,                int lim, char delim = '\n');
  486.     istream&    get(unsigned char* b,     int lim, char delim = '\n');
  487.     istream&    getline(char* b,          int lim, char delim = '\n');
  488.     istream&    getline(unsigned char* b, int lim, char delim = '\n');
  489.     istream&    get(streambuf& sb,                 char delim = '\n');
  490. #endif
  491.     istream&    get_complicated(unsigned char& c);
  492.     istream&    get_complicated(char& c);
  493. #ifdef powerc
  494.     istream&    get(unsigned char& c);
  495.     istream&    get(char& c);
  496. #else
  497. #ifdef applec
  498.     istream&    get(unsigned char& c)
  499.     {
  500.         if (!(ispecial & ~skipping) && bp->optim_in_avail())
  501.         {
  502.             x_gcount = 1;
  503.             c = bp->sbumpc();
  504.             return *this;
  505.         }
  506.         else
  507.             return (get_complicated(c));
  508.     }
  509.     istream&    get(char& c)
  510.     {
  511.         if (!(ispecial & ~skipping) && bp->optim_in_avail())
  512.         {
  513.             x_gcount = 1;
  514.             c = bp->sbumpc();
  515.             return *this;
  516.         }
  517.         else
  518.             return (get_complicated(c));
  519.     }
  520. #endif
  521. #endif
  522.     int get()
  523.     {
  524.         int c;
  525.         if (!ipfx(1))
  526.             return EOF;
  527.         else
  528.         {
  529.             c = bp->sbumpc();
  530.             if (c == EOF)
  531.                 setstate(eofbit);
  532.             return c;
  533.         }
  534.     }
  535.     int         peek()                                  { return (ipfx(-1)) ? bp->sgetc() : EOF; }
  536.     istream&    ignore(int n = 1, int delim = EOF);
  537.     istream&    read(char* s,int n);
  538.     istream&    read(unsigned char* s,int n)            { return read((char*)s, n); }
  539.     istream&    putback(char c);
  540.     int         gcount();
  541.     int         sync()                                  { return bp->sync(); }
  542. #ifdef powerc
  543.     void        eatwhite();
  544. #endif
  545.  
  546. protected:
  547. #ifdef applec
  548.     void        eatwhite();
  549.     int         do_ipfx(int noskipws);
  550. #endif
  551.     istream();
  552.  
  553. private:
  554.     int         x_gcount;
  555.     void        xget(char*  c);
  556. #ifdef powerc
  557.     long        scan_int();
  558. #endif
  559.  
  560. #ifdef applec
  561. public:
  562.     /*
  563.      * Obsolete constructors, carried over from stream package.
  564.      */
  565.     istream(streambuf*, int sk, ostream* t = 0);        // obsolete, set sk and tie via format state variables
  566.     istream(int size, char*, int sk = 1);               // obsolete, use strstream
  567.     istream(int fd, int sk = 1, ostream* t = 0);        // obsolete, use fstream
  568. #endif
  569.  
  570. };  // class istream
  571.  
  572.  
  573. class ostream : virtual public ios
  574. {
  575.  
  576. public:
  577.     /*
  578.      * Constructor, destructor
  579.      */
  580.     ostream(streambuf*);
  581.     virtual ~ostream();
  582.  
  583. public:
  584. #ifdef powerc
  585.     int         opfx();         /* Output prefix */
  586.     void        osfx();
  587. #else
  588. #ifdef applec
  589.     int         opfx()                                  { return (ospecial) ? do_opfx() : 1; }
  590.     void        osfx()                                  { if (osfx_special) do_osfx(); }
  591. #endif
  592. #endif
  593.     ostream&    flush();
  594.     ostream&    seekp(streampos p);
  595.     ostream&    seekp(streamoff o, ios::seek_dir d);
  596.     streampos   tellp();
  597.     ostream&    put(char c);
  598. #ifdef powerc
  599.     ostream&    operator<<(char c);
  600.     ostream&    operator<<(unsigned char c);
  601. #else
  602. #ifdef applec
  603.     ostream&    complicated_put(char c);
  604.     ostream&    ls_complicated(char c);
  605.     ostream&    ls_complicated(unsigned char c);
  606.     ostream&    operator<<(char c)
  607.     {
  608.         if (ospecial || osfx_special)
  609.             return ls_complicated(c);
  610.         else
  611.         {
  612.             if (bp->sputc(c) == EOF)
  613.                 setstate(eofbit | failbit);
  614.             return *this;
  615.         }
  616.     }
  617.     ostream&    operator<<(unsigned char c)
  618.     {
  619.         if (ospecial || osfx_special)
  620.             return ls_complicated(c);
  621.         else
  622.         {
  623.             if (bp->sputc(c) == EOF)
  624.                 setstate(eofbit | failbit);
  625.             return *this;
  626.         }
  627.     }
  628. #endif
  629. #endif
  630.     ostream&    operator<<(const char*);
  631.     ostream&    operator<<(const unsigned char*);
  632.     ostream&    operator<<(int a);
  633.     ostream&    operator<<(long l);
  634. #ifdef powerc
  635.     ostream&    operator<<(float d)                     { return (*this) << (long double)d; }
  636.     ostream&    operator<<(double d)                    { return (*this) << (long double)d; }
  637.     ostream&    operator<<(long double d);
  638. #else
  639. #ifdef applec
  640.     ostream&    operator<<(float d)                     { return (*this) << (extended)d; }
  641.     ostream&    operator<<(double d)                    { return (*this) << (extended)d; }
  642.     ostream&    operator<<(extended d);
  643. #endif
  644. #endif
  645.     ostream&    operator<<(unsigned int a);
  646.     ostream&    operator<<(unsigned long l);
  647.     ostream&    operator<<(void*);
  648.     ostream&    operator<<(streambuf*);
  649.     ostream&    operator<<(short i)                     { return *this << (int)i; }
  650.     ostream&    operator<<(unsigned short i)            { return *this << (int)i; }
  651.     ostream&    operator<<(ostream& (*f)(ostream&))     { return (*f)(*this); }
  652.     ostream&    operator<<(ios& (*f)(ios&));
  653.     ostream&    write(const char* s, int n)
  654.     {
  655.         if (!state)
  656.         {
  657.             if (bp->sputn(s, n) != n)
  658.                 setstate(eofbit | failbit);
  659.         }
  660.         return *this;
  661.     }
  662.     ostream&    write(const unsigned char* s, int n)    { return write((const char*)s, n); }
  663.  
  664. protected:
  665. #ifdef applec
  666.     int         do_opfx();
  667.     void        do_osfx();
  668. #endif
  669.     ostream();
  670.  
  671. #ifdef applec
  672. public:
  673.     /*
  674.      * Obsolete constructors, carried over from stream package.
  675.      */
  676.     ostream(int fd);            // obsolete, use fstream.
  677.     ostream(int size, char*);   // obsolete, use strstream.
  678. #endif
  679.  
  680. };  // class ostream
  681.  
  682.  
  683. class iostream : public istream, public ostream
  684. {
  685.  
  686. public:
  687.     iostream(streambuf*);
  688.     virtual ~iostream();
  689.  
  690. protected:
  691.     iostream();
  692.  
  693. };  // class iostream
  694.  
  695.  
  696. class Iostream_init;
  697.  
  698. class istream_withassign : public istream
  699. {
  700.  
  701. public:
  702.     istream_withassign();
  703. #ifdef applec
  704.     istream_withassign(Iostream_init*);
  705. #endif
  706.     virtual ~istream_withassign();
  707.     istream_withassign& operator=(istream&);
  708.     istream_withassign& operator=(streambuf*);
  709.  
  710. };  // class istream_withassign
  711.  
  712.  
  713. class ostream_withassign : public ostream
  714. {
  715.  
  716. public:
  717.     ostream_withassign();
  718. #ifdef applec
  719.     ostream_withassign(Iostream_init*);
  720. #endif
  721.     virtual ~ostream_withassign();
  722.     ostream_withassign& operator=(ostream&);
  723.     ostream_withassign& operator=(streambuf*);
  724.  
  725. };  // class ostream_withassign
  726.  
  727.  
  728. class iostream_withassign : public iostream
  729. {
  730.  
  731. public:
  732.     iostream_withassign();
  733.     virtual ~iostream_withassign();
  734.     iostream_withassign& operator=(ios&);
  735.     iostream_withassign& operator=(streambuf*);
  736.  
  737. };  // class iostream_withassign
  738.  
  739.  
  740. extern istream_withassign cin;
  741. extern ostream_withassign cout;
  742. extern ostream_withassign cerr;
  743. #ifdef powerc
  744. extern ostream_withassign clog;
  745. #else
  746. #ifdef applec
  747. extern ostream_withassign cdebug;
  748. #endif
  749. #endif
  750.  
  751.  
  752. ios&            dec(ios&);
  753. ostream&        endl(ostream& i);
  754. ostream&        ends(ostream& i);
  755. ostream&        flush(ostream&);
  756. ios&            hex(ios&);
  757. ios&            oct(ios&);
  758. istream&        ws(istream&);
  759.  
  760.  
  761. /*
  762.  * see iostream_init.c (or MPW cstearms.c)
  763.  */
  764. class Iostream_init
  765. {
  766.  
  767.     static int stdstatus;
  768. #ifdef powerc
  769.     static int initcount;
  770. #endif
  771.     friend ios;
  772.  
  773. public:
  774.     Iostream_init();
  775.     ~Iostream_init();
  776.  
  777. };  // class Iostream_init
  778.  
  779. #ifdef powerc
  780. #pragma options align=reset
  781. #endif
  782.  
  783. #endif
  784.